#Requires AutoHotkey v2.0

class OptionWindow {
    ; 定义静态方法
    static _on_setting(GuiCtrl, EventInfo) {
        MsgBox "Setting clicked"
    }

    ; 初始化方法
    static init() {
        this.gui := Gui()
        this.comp := Map()
        this.comp["setting"] := this.gui.Add("Button", "w100 h30", "设置")

        ; 绑定事件
        this.comp["setting"].OnEvent("Click", (g, e) => OptionWindow._on_setting(g, e))

        this.gui.Show()
    }
}

OptionWindow.init()
